package com.example.ch_71;

// 调用者 Invoker 
public class CalculateForm {

    private AbsCommand command;
    
    public CalculateForm() {
        this.command = new AdderCommend();
    }

    public void compute(int value) {
        int ret = this.command.execute(value);
        System.out.println("compute计算结果：" + ret);
    }

    public void undo() {
        int ret = this.command.undo();
        System.out.println("undo计算结果：" + ret);
    }
}